package com.xr.controller;

import com.xr.pojo.Person;
import jdk.nashorn.internal.ir.annotations.Ignore;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;


@RestController
public class HelloController {
//    @Value("${v-boolean}")
//    private boolean v_boolean;
//    @Value("${v-float}")
//    private float v_float;
//    @Value("${v-int}")
    @Value("${random.int[1024,65536]}")
    private int v_int;
//    @Value("${v-null}")
//    private Integer v_null;
//    @Value("${v-string}")
//    private String v_string;
//    @Value("${v-string2}")
//    private String v_string2;
//    @Value("${v-date}")
//    private Date v_date;

    @Autowired
    private Environment environment;
    @RequestMapping("hello")
    public String hello() {
//        System.out.println(v_boolean);
//        System.out.println(v_float);
        System.out.println(v_int);

//        System.out.println(v_null);
//        System.out.println(v_string);
//        System.out.println(v_string2);
//        System.out.println(v_date);
        System.out.println(environment.getProperty("v-date"));
        return "hello world哈哈哈";
    }
}
